/*
 * Copyright 2003-2006 (c) Live Media Pty Ltd. <argot@einet.com.au> 
 *
 * This software is licensed under the Argot Public License 
 * which may be found in the file LICENSE distributed 
 * with this software.
 *
 * More information about this license can be found at
 * http://www.einet.com.au/License
 * 
 * The Developer of this software is Live Media Pty Ltd,
 * PO Box 4591, Melbourne 3001, Australia.  The license is subject 
 * to the law of Victoria, Australia, and subject to exclusive 
 * jurisdiction of the Victorian courts.
 */

%include exception.i

%define BeginArgotExc
      $action
      switch (result)
      {
%enddef

%define ArgotExc( errcode, exc, description)
      case errcode:
		 SWIG_exception(exc, description);
		 return 0;
	  break;		
%enddef

%define EndArgotExc
     }
%enddef
      
%define ArgotNullExc( exc, description)
	$action
    if (!result)
    {
		 SWIG_exception(exc, description);
		 return 0;
	}
%enddef

%define ArgotConditionalExc( condition, exc, description)
	$action
    if (condition)
    {
		char buf[2048];
		sprintf( buf, "%s, error code %d", description, result );
		SWIG_exception(exc, buf);
		return 0;
	}
%enddef
